﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Movement : MonoBehaviour
{
    public Vector3 m_destinationPosition;
	public UnityEngine.AI.NavMeshAgent m_agent;
	int m_movSpeed;
    
    // Start is called before the first frame update
    void Start()
    {
        m_movSpeed=5;
       // m_clickGround=this.GetComponent<ClickGround>(); 
		m_agent = GetComponent<UnityEngine.AI.NavMeshAgent > ();
        DelegateManager.Instance.ClickGround+=Move;
    }
    void Move()
	{
        m_destinationPosition=PoolManager.Instance.m_Flag.transform.position;
		m_agent.speed = m_movSpeed;
  		m_agent.SetDestination (m_destinationPosition );
	}
}
